﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ShareMarking.SysEnitys;
using ShareMarking.SystemService;

namespace ShareMarking.EjtWeChat.Web.Tools {
	public partial class avatar : System.Web.UI.Page {
		public avatar()
		{
			var par = ComLib.QueryStringHelper.GetStringByQueryString("uid");
			string avatarUrl = "";
			if ( par != "")
			{
				if (ComLib.RegexHelper.IsNumber(par))
					avatarUrl = Avatars.GetAvatarUrl(par.ConvertTo<Int32>());
				else
				{
					var user = SysUserService.Instance.Get_SingleEntity_byWhere(
						sys_User._.U_LoginName == par
						);
					avatarUrl = user == null ? "" : Avatars.GetAvatarUrl(user.UserID);
				}
			}

           
            HttpContext.Current.Response.Redirect(avatarUrl);

		}

		protected void Page_Load(object sender, EventArgs e) {

		}
	}
}